﻿//using Autofac;
using System.Reflection;

namespace SportsPlatform.Web.Host.IoCDependencyInjection
{
    /// <summary>
    /// 依赖自动注入
    /// </summary>
    //public class DependencyAutoInjection : Autofac.Module
    //{
    //    protected override void Load(ContainerBuilder builder)
    //    {
    //        //业务逻辑层程序集
    //        Assembly application = Assembly.Load("SportsPlatform.Application");
    //        Assembly core = Assembly.Load("SportsPlatform.Core");
    //        Assembly webCore = Assembly.Load("SportsPlatform.Web.Core");
    //        Assembly webHost = Assembly.Load("SportsPlatform.Web.Core");
    //        //自动注入
    //        builder.RegisterAssemblyTypes(application).Where(t => t.Name.EndsWith("Application")).AsImplementedInterfaces();
    //        //自动注入
    //        builder.RegisterAssemblyTypes(core).Where(t => t.Name.EndsWith("Core")).AsImplementedInterfaces();
    //        builder.RegisterAssemblyTypes(webCore).Where(t => t.Name.EndsWith("WebCore")).AsImplementedInterfaces();
    //        builder.RegisterAssemblyTypes(webHost).Where(t => t.Name.EndsWith("WebHost")).AsImplementedInterfaces();
    //    }
    //}
}
